#include "my_thread.h"

#include <QThread>
#include <QDebug>

My_Thread::My_Thread(QObject *parent) : QObject(parent)
{
    isStop = false;
}

void My_Thread::myTimerout()
{
    while (isStop == false) {
        //QThread::sleep(1);
        //微妙
        //QThread::usleep(10000);
        //毫秒
        QThread::msleep(100);
        emit mySignal();
        qDebug() << "子线程>>>>" << QThread::currentThread();
        if (true == isStop) {
            break;
        }
    }
}

void My_Thread::setFlag(bool flag)
{
    isStop = flag;
}
